<?php

namespace app\models;

use Yii;




/**
 * This is the model class for table "kd_school".
 *
 * @property integer $yey_id
 * @property string $yey_mingcheng
 * @property string $yey_sheng
 * @property string $yey_shi
 * @property string $yz_name
 * @property integer $yz_phone
 * @property string $gl_name
 * @property integer $gl_phone
 * @property string $yey_xz
 * @property integer $yey_jg
 * @property string $yey_jianjie
 * @property string $add_shijian
 * @property string $xiugai_shijian
 * @property string $xiugai_ren
 */
class School extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'kd_school';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['yey_mingcheng', 'yey_sheng', 'yey_shi', 'yz_name', 'yz_phone', 'yey_xz'], 'required'],

            [['yz_phone', 'gl_phone', 'yey_jg'], 'integer'],
            [['yey_jianjie','yey_type','yey_www','stu_num'], 'string'],
            [['add_shijian', 'xiugai_shijian'], 'safe'],
            [['yey_mingcheng'], 'string', 'max' => 100],
            [['yey_sheng', 'yey_shi', 'yz_name', 'gl_name', 'yey_xz'], 'string', 'max' => 20],

            [['yey_xz'], 'integer'],
            [['yey_jianjie'], 'string'],
            [['add_shijian', 'xiugai_shijian'], 'safe'],
            [['yey_mingcheng'], 'string', 'max' => 100],
            [['yey_sheng', 'yey_shi', 'yz_name', 'yz_phone', 'gl_name', 'gl_phone'], 'string', 'max' => 20],

            [['xiugai_ren'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'yey_id' => '幼儿园序号',

            'yey_mingcheng' => '名称',
            'yey_type' => '类型',
            'yey_www' => '幼儿园网址',
            'stu_num' => '幼儿园学生总数',

            'yey_sheng' => '省',
            'yey_shi' => '市',
            'yz_name' => '园长姓名',
            'yz_phone' => '园长手机号',
            'gl_name' => '管理姓名',
            'gl_phone' => '管理手机号',


            'yey_jg' => '所属机构',

            'yey_xz' => '幼儿园类型',
            'yey_jt' => '所属机构',

            'yey_jianjie' => '简介',
            'add_shijian' => '添加时间',
            'xiugai_shijian' => '最后修改时间',
            'xiugai_ren' => '修改人',
        ];
    }

    public function behaviors()
    {
        return [
            [
                'class'=>\app\components\behaviors\CreatorBehaviors::className(),
                'fieldName'=>'xiugai_ren',
            ],
            [
                'class'=>\app\components\behaviors\DatetimeBehavior::className(),
                'createDate'=>'add_shijian',
                'updateDate'=>'xiugai_shijian'
            ],
            [
                'class' => \app\components\behaviors\LogBehavior::className(),
                'tableName' => '机构',
                'attributeValue' => 'yey_mingcheng',
            ],
            [
                'class' => \app\components\behaviors\UserBehavior::className(),
            ],
            [
                'class'=>\app\components\behaviors\RecoverBehavior::className(),
            ],


        ];
    }

}
